String command= "";
String token1= "";
String token2= "";
String token3= "";
boolean chunkedCommand = false;

void setup() {
  Serial.begin(9600);

}



void loop() {
  getCommand();
  chunk();
  interpret();
}


void getCommand() {
  while (!Serial.available())
  {   
  }
  command="";
  while (Serial.available())
  {
    command+=char((Serial.read()));
    delay(2);
  }
  Serial.println(command);
  command.toLowerCase();
}

void chunk() {
  if(command.indexOf(":") != -1){
    chunkedCommand = true;
    int place1=command.indexOf(":");
    token1=command.substring(0,place1);
    int place2=command.indexOf(":",place1+1);
    token2=command.substring(place1+1,place2);
    token3=command.substring(place2+1, command.indexOf("<") - 1);
  }
  else{
    chunkedCommand = false;
  }
}



void interpret() {
  if(chunkedCommand){
    if(token1 == "write" || token1 == "w"){
    }
  }

  else{
    if(command == "long test"){
Serial.println("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
      }


    }
  }







